<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <style>
    html{
      overflow-y: scroll;
      overflow-x: scroll;
    }
    body{
      zoom: 100%;
    }

  </style>
  {include file="_container/common_index"}
</head>


<body>

<div class="layui-fluid padding-top-20">
  <div class="layui-card">
    <div class="layui-form-header">
      <div class="header-left">
        {block name="left"}
        {/block}
      </div>

      <div class="header-right">
        <form action="{:url()}" method="get" class="layui-form-pane">
          {block name="right"}
          {/block}
        </form>
      </div>
    </div>
    <div class="layui-card-body">

      <form class="layui-form"  lay-filter="component-form-element" action="{:url()}"  method="post" onsubmit="return save_form(this);">

        <table class="layui-table" lay-filter="table1">

          <thead>
          <tr>
            {block name="table_header"}
            {/block}
          </tr>
          </thead>
          <tbody>
          {foreach $data as $k=>$v}
            {block name="table_body"}

            {/block}
          {/foreach}
          </tbody>

        </table>
        <div class="layui-inline">
          {block name="table_footer"}
          {/block}
        </div>
      </form>
      <div class="layui-box layui-laypage layui-laypage-default">{$paginate|raw}</div>
    </div>

  </div>
</div>



<script>

  $(document).ready(function() {
    $("a.fancybox").fancybox();
    $('.select2').select2();
  })

</script>


{block name="js"}
{/block}


  <script>
    function exportTable(){
    // 使用outerHTML属性获取整个table元素的HTML代码（包括<table>标签），然后包装成一个完整的HTML文档，设置charset为urf-8以防止中文乱码
    var html = "<html><head><meta charset='utf-8' /></head><body>" + document.getElementsByTagName("table")[0].outerHTML + "</body></html>";
    // 实例化一个Blob对象，其构造函数的第一个参数是包含文件内容的数组，第二个参数是包含文件类型属性的对象
    var blob = new Blob([html], { type: "application/vnd.ms-excel" });
    var a = document.getElementById("download_a");
    // 利用URL.createObjectURL()方法为a元素生成blob URL
    a.href = URL.createObjectURL(blob);
    // 设置文件名
    a.download = "{$exportName}.xls";
    a.click()
  }
</script>

</body>
</html>
